/*
Powerup1: Honguito
*/
var powerups = {
	id: "powerups",
	
	visible: false,

	posX:0,
	posY:0,
	vel: -1,
	inicio: true,
	initPos: 0,
	
	spawn: function (x,y) {
		this.posX = x;
		this.posY = y;
		this.visible = true;
		this.initPos = y;
	},

	num: 0,
	
	update: function (delta) {
	if(this.visible){
		
		if (!this.inicio){
		this.posX += this.vel;
		
		if (this.vel > 0){
			num = jsGFwk._gameObjects.mapa._getGridRelation(this.posX+1, this.posY).tile;
			}
		else{
			num = jsGFwk._gameObjects.mapa._getGridRelation(this.posX-17, this.posY).tile;
			}
		
		if(num == 1){
			this.vel *= -1;
			}
		
		num = jsGFwk._gameObjects.mapa._getGridRelation(this.posX, this.posY+17).tile;
		if(num == 0){
			this.posY++;
			}
		}
		else{
			this.posY -=0.5;
			if (this.initPos - this.posY >= 16){this.inicio = false;} 
		}
		}
		
	},

	draw: function (context) {
	if(this.visible){
		context.drawImage(jsGFwk.ResourceManager.graphics.sprites.image, 
			70, 42, 17, 17,	this.posX, this.posY, 17, 17);
		}	
	},
	/*
	CreateHongo: function(x,y){
		this.posX = x;
		this.posY = y;
		this.visible = true;
	}
	*/
};
